<!DOCTYPE html >
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="chrome=1">

    <!--
        /**
        * o------------------------------------------------------------------------------o
        * | This file is part of the RGraph package - you can learn more at:             |
        * |                                                                              |
        * |                          http://www.rgraph.net                               |
        * |                                                                              |
        * | This package is licensed under the RGraph license. For all kinds of business |
        * | purposes there is a small one-time licensing fee to pay and for non          |
        * | commercial  purposes it is free to use. You can read the full license here:  |
        * |                                                                              |
        * |                      http://www.rgraph.net/LICENSE.txt                       |
        * o------------------------------------------------------------------------------o
        */
    -->
    <title>RGraph: Javascript charts library - line charts</title>
    
    <meta name="keywords" content="rgraph html5 canvas example line chart" />
    <meta name="description" content="RGraph: Javascript charts library - Line chart example" />
    
    <meta property="og:title" content="RGraph: Javascript charts library" />
    <meta property="og:description" content="A charts library based on the HTML5 canvas tag" />
    <meta property="og:image" content="http://www.rgraph.net/images/logo.png"/>

    <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
    <link rel="icon" type="image/png" href="../images/favicon.png">
    
    <!-- Place this tag in your head or just before your close body tag -->
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.context.js" ></script>
    <script src="../libraries/RGraph.common.annotate.js" ></script>
    <script src="../libraries/RGraph.common.tooltips.js" ></script>
    <script src="../libraries/RGraph.common.zoom.js" ></script>
    <script src="../libraries/RGraph.common.resizing.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>
    <!--[if IE 8]><script src="../excanvas/excanvas.original.js"></script><![endif]-->

    <script>
        window.onload = function ()
        {
            var line1 = new RGraph.Line('line1', [56,45,43,52,56,65,21,23,34,15,21,-12,-13,-31,-25], [35,43,41,41,42,46,42,39,46,41,45,65,54,54,41,41]);
            line1.Set('chart.background.barcolor1', 'white');
            line1.Set('chart.background.barcolor2', 'white');
            line1.Set('chart.background.grid', true);
            line1.Set('chart.linewidth', 5);
            line1.Set('chart.gutter.left', 35);
            line1.Set('chart.hmargin', 5);
            if (RGraph.isIE9up()) {
                line1.Set('chart.shadow', true);
            }
            line1.Set('chart.tickmarks', null);
            line1.Set('chart.units.post', 'k');
            line1.Set('chart.xticks', 8);
            line1.Set('chart.colors', ['red', 'green']);
            line1.Set('chart.key', ['Sales (not good)','Costs (reasonably consistent)']);
            line1.Set('chart.key.shadow', true);
            line1.Set('chart.key.shadow.offsetx', 0);
            line1.Set('chart.key.shadow.offsety', 0);
            line1.Set('chart.key.shadow.blur', 15);
            line1.Set('chart.key.shadow.color', '#ddd');
            line1.Set('chart.key.rounded', true);
            line1.Set('chart.key.position', 'graph');
            line1.Set('chart.key.position.x', line1.Get('chart.gutter.left') + 4);
            line1.Set('chart.key.position.y', (line1.canvas.height / 2) + 5);
            line1.Set('chart.xaxispos', 'center');
            line1.Set('chart.background.grid.autofit', true);
            line1.Set('chart.background.grid.autofit.numhlines', 10);
            line1.Set('chart.title', 'Sales last year');
            line1.Set('chart.curvy', true);
            line1.Set('chart.curvy.factor', 0.25);
            line1.Draw();
            
            var line2 = new RGraph.Line('line2', [6,5,4,5,6,4,1,2,3], [7,8,9,9,8,7,8,7,6]);
            line2.Set('chart.labels', ['13th','14th','15th','16th','15th','16th','17th','18th','19th']);
            line2.Set('chart.title', 'Range of fuel consumption');
            line2.Set('chart.title.vpos', 0.5);
            line2.Set('chart.background.barcolor1', 'white');
            line2.Set('chart.background.barcolor2', 'white');
            line2.Set('chart.background.grid.autofit.align', true);
            line2.Set('chart.filled', true);
            line2.Set('chart.filled.range', true);
            line2.Set('chart.fillstyle', 'rgba(128,255,128,0.5)');
            line2.Set('chart.linewidth', 2);
            line2.Set('chart.colors', ['green']);
            line2.Set('chart.hmargin', 5);
            line2.Draw();
        }
    </script>

</head>
<body>

<h1>RGraph: <span>Javascript charts library</span> - Line charts</h1>

    <script>
        if (RGraph.isIE8()) {
            document.write('<div style="background-color: #fee; border: 2px dashed red; padding: 5px"><b>Important</b><br /><br /> Internet Explorer 8 does not natively support the HTML5 canvas tag, so if you want to see the charts, you can either:<ul><li>Install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a></li><li>Use ExCanvas. This is provided in the RGraph Archive.</li><li>Use another browser entirely. Your choices are Firefox 3.5+, Chrome 2+, Safari 4+ or Opera 10.5+. </li></ul> <b>Note:</b> Internet Explorer 9 fully supports the canvas tag.</div>');
        }
    </script>
    
    <div>
        <p>
            Like Bar charts, Line charts are some of the most versatile chart types. It is similar, but can indicate chronological
            data better. Line charts are good if, for example, you want to illustrate sales figures over a year (or any period of
            time). You'll then be able to easily see whether sales are going up, down or are stagnant. It will also become apparent
            which months are busier than others. By using a multiple line chart you can add multiple sets of data (eg two or more years
            of figures) to your chart. You can customise the line chart by stipulating it as being filled, having drop shadows, keys,
            having the X axis in the centre, different colors, different tickmark styles and tooltips etc.
        </p>
    
        <div>
            <ul>
                <li><a href="../docs/line.html">Line charts API documentation</a></li>
            </ul>
        </div>

        <div>
            <canvas id="line1" width="475" height="250">[Please wait...]</canvas>
            <canvas id="line2" width="475" height="250">[Please wait...]</canvas>
        </div>
    </div>

</body>
</html>